package com.iqiny.silly.demo.common.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 页面跳转 通用路由
 */
@Controller
public class RoutePageController {

    /**
     * 模块主页面跳转
     *
     * @param module
     * @param page
     * @return
     */
    @GetMapping(value = "/{module}/{page}.html")
    public String index(@PathVariable("module") String module, @PathVariable("page") String page) {
        return "/" + module + "/" + page;
    }


    /**
     * 模块表单处置页面跳转
     *
     * @param module
     * @return
     */
    @GetMapping(value = "/{module}/{version}/{page}.html")
    public String taskForm(@PathVariable("module") String module, @PathVariable("version") String version, @PathVariable("page") String page) {
        return "/" + module + "/" + version + "/" + page;
    }

}
